home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / os2tools / bnklysrc / readme.os2 < prev    next >
Encoding:
Text File  |  1989-06-14  |  6.3 KB  |  143 lines

  1. Binkley Term. Os/2 version notes. By Peter Fitzsimmons 1:250/628
  2. Data  - RT LAB BBS, (416) 867-9663, Toronto.
  3. Voice - (416) 981-3867
  4.  
  5. -------------------------------------------------------------------
  6. QuickStart:
  7.  
  8. GO.BAT            - make btr.exe and btctlr.exe (real mode (dos) programs)
  9. GO.CMD            - make btp.exe and btctlp.exe (protect mode (os/2) progs)
  10.  
  11. These programs where compiled using :
  12.  
  13. cl.exe   Microsoft C Optimizing Compiler Version 5.10
  14. link.exe Microsoft Segmented-Executable Linker  Version 5.01.21 (os/2),
  15. link.exe Microsoft Overlay Linker  Version 3.65                 (dos),
  16. masm.exe Microsoft Macro Assembler Version 5.10
  17. make.exe Microsoft Program Maintenance Utility  Version 4.07
  18. and the include files in the MS SDK 1.06 (software development kit).
  19.  
  20. The os/2 version should compile without ANY warnings. The Dos version
  21. compiles with TWO warnings (sb_show.c line 96 and 115) and can be
  22. ignored.
  23. --------------------------------------------------------------------
  24. It took me longer to port this to os/2 than I originally thought. I
  25. was quite excited when I got the source code for Binkley, since
  26. the readme's said it compiled at -W3 without warning (almost). Usually
  27. when this kind of care is taken, the code is easy to port..even easier
  28. when the target environment uses exactly the same C compiler! (msc 5.10
  29. in this case).
  30.  
  31. It took so long (4 "all-nighters") for two reasons: 1) Two weeks
  32. ago I thought fido-net was something a dog-catcher used. One of
  33. my co-sysops (Robert Ames) is in the process of trying to make
  34. us an active node in the fido-net, and as a usenet gateway. Anyway...
  35. since I no nothing about Barking, WaZoo'ing, YooHoo/2u2'ing you can imagine
  36. how difficult it was for me to understand exactly what the code does.
  37. In fact, Robert Ames had quite a laugh when I called him up and said
  38. "Guess what? I ported Binkley Term to os/2. Can you tell me what it
  39. does?".
  40.  
  41. 2) Dos programmers sometimes have bad habits that are no longer valid
  42. in os/2. For example, strlen(string) when string==NULL causes a GP
  43. (General Protection) Fault, because you don't own the memory
  44. at 0000:0000. Another example would be :
  45.  
  46. int main(int argc, char **argv)
  47. {
  48.         if( *argv[2]=='-' ){
  49.             ...
  50.         }
  51. }
  52.  
  53. If the user did not invoke the program with at least one argument,
  54. this program would blow up (in the large or compact memory model's for
  55. sure). The fix in the above example would be:
  56.  
  57.        if( argv[2] && *argv[2]=='-' ){
  58.            ...
  59.        }
  60.  
  61. It took a while to track many of these down in the
  62. binkley code, and i am SURE there are more in there....However, these
  63. bugs (and they are bugs..strlen(NULL) is no less than a bug) do not
  64. cause GP violations in a memory model with NEAR data (small, medium)
  65. nearly as often. So, if you compile BT in the medium model, the bugs
  66. will not cause the program to crash in many cases.
  67.  
  68. (aside: I hope others, like me, see why os/2 is such a great place
  69.         to develop programs...even if the program is intended for DOS.
  70.         If it will run in os/2, large model, /Ox /W3, you know the
  71.         code is good.)
  72.  
  73. As of this writing (Tue  05-09-1989) the ported code has not been
  74. used in a real situation -- I have not ported a scanner, tosser or
  75. msg editor yet (and anything else that may be required). My main
  76. short-term motivation for porting Binkley Term to os/2 was to use
  77. it as a simple terminal program on the MicroSoft Network (I can
  78. make binkley term use a modem on a different computer) The only
  79. com program that supported up/downloads that I know of is
  80. LOGICOM, and it broke a few rules, so it won't work on a remote
  81. modem. The ported code has been tested somewhat though..it succeeded
  82. in sending and receiving mail packets and files with Front Door 1.99
  83. running on a dos machine, and with opus 1.03b.
  84.  
  85. I have done most of the work though...it compiles into an EXE and loads(
  86. it took two days to get to that point...until that moment I didn't
  87. know if it was even possible to port this program!). So, if someone
  88. that knows more about the operation of this program has the resources
  89. (ie: os/2), s/he will be able to find and fix any deficiencies I
  90. have left behind.
  91.  --------------------------------------------------------------------
  92. dfind() had to be scrubed. I replaced it with an API I developed some
  93. time ago that fits into all of OS/2, DOS, and FAPI programs. The basic
  94. flow is:
  95.  
  96.         handle = opendir();
  97.         done = findfirst(handle, ...);
  98.         while(!done)
  99.           done = findnext(handle);
  100.         closedir(handle);
  101.  
  102. This method lends itself nicely to "walking" trees, and is easy on
  103. the stack.
  104. I had a little trouble plugging this into mailsubs.c -- please see
  105. comments there.
  106. -----------------------------------------------------------------------
  107. nodeproc.c is a mess. I had to put a few extra status_line() calls
  108. in there so I could tell why unattended mode was ending as soon
  109. as it was started. The problems seems to be linked with not having
  110. a boss defined, or not having all 3 of boss, bossPhone and bossPwd defined
  111. in binkley.cfg
  112. ------------------------------------------------------------------------
  113. in mailsubs.c, near line 430, put this in:
  114. if( cur_event < 0 )
  115.         return(rettype);
  116.  
  117. I have no idea what is supposed to happen here, but you can't refer to
  118. e_ptrs[-1].xxx in os/2 (or in reality) when there ain't no e_ptr[-1]!!
  119. ----------------------------------------------------------------------
  120. I disocovered a bug in the fstat() MSC libary function. It only appears
  121. when in os/2 and calling fstat() on a network file. For this reason
  122. i am including a fixed version of fstat.obj (medium model)...you
  123. won't be able to compile fstat.c unless you purchased the MSC 5.10
  124. runtime library source code.
  125. ----------------------------------------------------------------------
  126. b_flofil.c(184) looked like:
  127.  
  128.         i = open (sptr, O_TRUNC, S_IWRITE);
  129.   
  130. and had to be changed to
  131.  
  132.         i = open (sptr, O_WRONLY | O_TRUNC, S_IWRITE);
  133.  
  134. The MSC manual states:
  135.  
  136. "Either O_RDONLY, O_RDWR, or O_WRONLY must be given to specify the access
  137. mode. There is no default value for the access mode."
  138.  
  139. - DOS didn't seem to care, but os/2 failed to truncate the file. Thanks
  140. to Gerry Rozema for discovering this bug.
  141. ----------------------------------------------------------------------
  142.  
  143.